home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / gateway.idb / usr / WebFace / Apps / major-info.cgi.z / major-info.cgi
Encoding:
Text File  |  1997-07-30  |  2.7 KB  |  99 lines

  1. #!/usr/bin/perl5
  2.  
  3. require "/usr/OnRamp/lib/OnRamp.pm";
  4.  
  5. ($list, $owner, $list_query) = split(/:/, $ENV{'QUERY_STRING'});
  6. $root_dir = "$document_root/apps/majordomo/$list";
  7. $list_root = "/usr/freeware/lib/majordomo/lists";
  8. $url_root = $ENV{'SERVER_URL'} . "/apps/majordomo/$list";
  9. $dummy = $root_dir . "/dummy";
  10. $num_file = "$root_dir/num";
  11. $list_link = "major-info.cgi?$ENV{'QUERY_STRING'}:l";
  12.  
  13. if (-e $num_file) {
  14.     open(IN, "< $num_file");
  15.     $num = <IN>;
  16.     close(IN);
  17. } else { $num = 0; }
  18.  
  19. $file = $list_root . "/$list" . ".creation";
  20. if (-e $file) { 
  21.     open(IN, "< $file");
  22.     $c_date = <IN>;
  23.     close(IN);
  24. }
  25.  
  26. $file = $list_root . "/$list" . ".config";
  27. if (-e $file) {
  28.     open(IN, "< $file");
  29.     while(<IN>) {
  30.         @items = split(/\s+/);
  31.         if ($items[0] eq "moderate") { $moderate = $items[2]; }
  32.         if ($items[0] eq "subscribe_policy") { $sub_pol = $items[2]; }
  33.     }
  34. }
  35.  
  36. $file = $list_root . "/$list";
  37. if (-e $file) {
  38.     open(IN, "< $file");
  39.     while(<IN>) { chop $_; push(@subs, $_); }
  40.     close(IN);
  41.     $n_sub = $#subs + 1;
  42. }
  43.  
  44. $file = $list_root . "/$list" . ".info";
  45. if (-e $file) {
  46.     open(IN, "< $file");
  47.     while(<IN>) { $info .= $_; }
  48.     close(IN);
  49.     $info =~ s/\n/<br>\n/g;
  50. }
  51.  
  52. print "Content-type: text/html\n\n";
  53. &make_page;
  54.  
  55. sub make_page {
  56.     print "<body bgcolor=#FFFFFF>\n"; 
  57.     $str = "<h2>$list info<br></h2>";
  58.  
  59.     if ($num > 0) {
  60.         $str .= "<a href=\"majordomo/$list/date.html\">[date]</a>\n"
  61.         . "<a href=\"majordomo/$list/subject.html\">[subj]</a>\n"
  62.         . "<a href=\"majordomo/$list/author.html\">[auth]</a>\n";
  63.     }
  64.     
  65.     print "<table width=100%>",
  66.         "<tr><th align=left>$str</th>\n",
  67.         "<th align=right><a href=\"/newsplash.shtml\">",
  68.         "<img height=55 width=57 border=0 src=/apps/home.gif></a>\n",
  69.         "  <a href=\"Apps.shtml\">",
  70.         "<img height=55 width=57 border=0 src=/apps/back.gif></a>",
  71.         "  <a href=\"/apps/Apps.major.cgi\">",
  72.         "<img height=60 width=80 border=0 src=\"/apps/major.gif\">",
  73.         "</tr></table><br><br>\n";
  74.  
  75.     print "<i>$message</i>\n";
  76.     print "<center><table width=550>\n"
  77.         . "<tr><th align=left>Owner:<td><a href=\"mailto:$owner\">$owner</a></td></tr>\n"
  78.         . "<tr><th align=left>Moderated:<td><i>$moderate</i></td></tr>\n"
  79.         . "<tr><th align=left>Subscription policy:<td><i>$sub_pol</i></td></tr>\n"
  80.         . "<tr><th align=left>Creation date:<td><i>$c_date</i></td></tr>\n"
  81.         . "<tr><th align=left>Number of letters:<td><i>$num</i></td></tr>\n";
  82.  
  83.     print "<tr><th align=left>Number of subscribers:<td><i>";
  84.     if ($list_query eq "l" || $sub_pol eq "closed") {
  85.         print $n_sub;
  86.     } else {
  87.         print "$n_sub (<a href=$list_link>list subscibers</a>)";
  88.     }
  89.     print "</i></td></tr>\n";
  90.     if ($list_query eq "l") {
  91.         foreach (@subs) {
  92.             print "<tr><td align=left>  $_</td></tr>\n";
  93.         }
  94.     }
  95.  
  96.     print "<tr><th align=left valign=top>Info:<td><i>$info</i></td></tr>\n"
  97.         . "</table></center>\n";
  98. }
  99.